#ifndef USLIDER
#define USLIDER
#include "../stdafx.h"
#include "UControl.h"
#include "../UCallBack.h"

typedef enum {
	Horizontal	= 1,
	Vertical	= 2
} TDirection;

class TSlider: public TControl
{
protected:
	bool Pressed;
	TDirection Direction;
	int SliderPos();
public:
	TSlider(TRectangle rect, TDirection direction);
	virtual void MouseDown	(int X, int Y, uint8 button);
	virtual void MouseUp	(int X, int Y, uint8 button);
	virtual void MouseLeave	();
	virtual void MouseMove	(int X, int Y, int mstate);
	virtual void Draw();
	function<void()> onMove;
	int Position;
	int MaxPosition;
};

#endif
